"use strict";

var timeout;
app.controller("QueryCostDetailsController", ["$scope", "$modal", "$timeout", "RESTService",
                                function($scope,   $modal,   $timeout,   RESTService) {
    
    $scope.doctFees = [];
    $scope.like = "";
    $scope.doctorType = "";
    $scope.item = {
    	startDate: moment(new Date()).format('YYYY-MM-01'),
    	finishDate: moment(new Date()).format('YYYY-MM-DD')
    }
    var loadListData = function() {
    	var startDate = moment($scope.item.startDate).format('YYYY-MM-DD');
    	var finishDate = moment($scope.item.finishDate).format('YYYY-MM-DD');
    	RESTService.getResponse("/rest/servreq/getDoctFees?like=" + $scope.like +
    		"&startDate=" + startDate + "&finishDate=" + finishDate + "&doctorType=" + $scope.doctorType).then(function(response) {
	    	$scope.doctFees = response;
	    });
    }
    $scope.init = function() {
    	loadListData();
    }
    $scope.query = function() {
    	loadListData();
    }
}]);
